<script setup>
import { ref, onMounted } from 'vue'
const myFrame = ref(null)
const loading = ref(true)
const props = defineProps({
  xml: {
    type: String,
    default: ''
  }
})


onMounted(() => {
  myFrame.value.onload = () => {
    let postMsg = {
      xml: props.xml,
      // 后端查询到的xml，新建则为空串
      isView: true
    }
    // 设置初始化值
    myFrame.value.contentWindow.postMessage(postMsg, "*")
    loading.value = false
  }

})
</script>
<template>
  <div class='flowChart-container' v-loading="loading">
    <iframe src="/static/workFlow/index.html" ref="myFrame" frameborder="0" width="100%">
    </iframe>
  </div>

</template>

<style lang="scss" scoped>
iframe {
  height: 80vh;
}
</style>